package com.zego.wawaji.ui.dialog;

import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.zego.wawaji.R;
import com.zego.wawaji.ui.dialog.popup.BottomPopup;

/**
 * 抓到娃娃弹框
 * Created by Su on 2017/11/30.
 */
public class CatchWawaDialog extends BottomPopup {
    private TextView playAgain;
    private TextView close;

    private ImageView imgCenter;
    private TextView tvTitle;


    public CatchWawaDialog(FragmentActivity activity) {
        super(activity);
    }

    @Override
    protected View makeContentView() {
        View inflate = LayoutInflater.from(activity).inflate(R.layout.catch_wawa_dialog, null);
        close = (TextView) inflate.findViewById(R.id.close_btn);
        playAgain = (TextView) inflate.findViewById(R.id.btn_again);
        imgCenter = (ImageView) inflate.findViewById(R.id.img_center);
        tvTitle = (TextView) inflate.findViewById(R.id.tv_title);
        return inflate;
    }

    public void setPositiveButton(View.OnClickListener listener) {
        playAgain.setOnClickListener(listener);
    }

    public void setNegativeButton(View.OnClickListener listener) {
        close.setOnClickListener(listener);
    }

    public void setCountTimes(String msg) {
        playAgain.setText(msg);
    }

    public void setImgCenter(int res) {
        imgCenter.setBackgroundResource(res);
    }

    public void setTitle(String title) {
        tvTitle.setText(title);
    }
}